#ifndef FILE_INFO_TAB_M_H
#define	FILE_INFO_TAB_M_H

#include "stdint.h"
#include "rtctime.h"

#ifdef	__cplusplus
extern "C" {
#endif	

    typedef enum file_info_err_enum
    {
        FILE_INFO_ERR_NONE =0,
        FILE_INFO_ERR_RENAME = 1,
        FILE_INFO_ERR_PTAB=2,
        FILE_INFO_ERR_LEN=3,
        FILE_INFO_ERR_FULL = 4,
        FILE_INFO_ERR_NO_FILE = 5,
        FILE_INFO_ERR_NO_SITE = 6,
    }file_info_err_type;

	typedef struct file_info_str
	{
        int32_t name;
		uint32_t addr_base;
		uint32_t size;      
        uint32_t attr;
	} file_info_type;

    typedef struct file_info_cfg
    {
        file_info_type *tab;
        int16_t tab_len;
        int16_t act_file_amount;
        int16_t search_site;
        file_info_err_type err;
    } file_info_cfg_type;

    file_info_err_type file_info_tab_init(file_info_cfg_type *cfg);
    file_info_err_type file_info_tab_clr(file_info_cfg_type *cfg);
    file_info_err_type file_info_tab_name_add(file_info_cfg_type *cfg, uint32_t addr, uint32_t size, char *name);
    file_info_err_type file_info_tab_name_quick_search(file_info_cfg_type *cfg, char *name);
    file_info_err_type file_info_tab_name_search(file_info_cfg_type *cfg, char *name);
    file_info_err_type file_info_tab_site_del(file_info_cfg_type *cfg, int16_t site);
    file_info_err_type file_info_tab_name_del(file_info_cfg_type *cfg, char *name);

#ifdef	__cplusplus
}
#endif

#endif	
